package com.service;

import java.util.ArrayList;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dao.ProductDao;
import com.hibernate.pojo.Product;

@Service("productService")
public class ProductService {
	
	@Resource(name="product")
	private Product p;
	@Resource(name="productDao")
	private ProductDao pd;
	
	public boolean update(String name,int number,double price,String info){
		p.setContent(info);
		p.setName(name);
		p.setNumber(number);
		p.setPrice(price);
		return pd.update(p);
	}
	
	public ArrayList<Product> getall(){
		return pd.getall();
	}
	
	public Product get(int id){
		return pd.get(id);
	}
}
